<!--# layout("/common/leftmallout.html",{"jsBase":"/js/user/userAdvance/"}){ -->
<link rel="stylesheet" href="http://ziyunoss.oss-cn-hangzhou.aliyuncs.com/pop/mall/style/member.css">
<div class="center">
	<div class="section">
    	<!-------------面包屑--------------------->
            <div class="bread-crumbs">
                    <br/>
                </div>
        <!------------------主体结构--------------------->
        <div class="small-page">
        <!--左侧-->

       <!-------左侧end-------->
       <!-------右侧-------->
            <div class="page-article">
            	<div class="area_mend_head">
                    <span>预存款充值</span>
                    <i class="member-more-r">您当前的预存款余额为：<strong class="advance"></strong> </i>
                </div>
              
                <div class="area_mend_body">
                	<div class="area_password">
                    	<p>
                        	<label>充值金额：</label>
                            <span>
                            	<input type="text" id="rechargeAmount" value=""/>
                            </span>
                        </p>
                        <p>
                        	<label>选择充值方式：</label>
                        	<input type="hidden" id="payType" value="umfalipay"/>
                            <span style="vertical-align:text-top; margin-left:20px;">
                            	<label for="a1" class="payment active" value="umfalipay"><em></em>支付宝 </label>
                                <label for="a2" class="payment" value="umfweixinpay" ><em></em>微信支付 </label>
                                <label for="a3"class="payment" value="umfupacppay"><em></em>银联支付 </label>
                            </span>
                        </p>
                        <!-- 
                        <div class="paycenter_list">
                                 <s></s>
                                 <input type="hidden" class="pay_type_list" id="bankCode" name="bankCode" value="">
                                 <p>
                                     <b pay_type_list="BOC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-01.png"></b>
                                     <b pay_type_list="ABC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-02.png"></b>
                                     <b pay_type_list="ICBC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-03.png"></b>
                                     <b pay_type_list="CCB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-07.png"></b>
                                     <b pay_type_list="COMM"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-15.png"></b>
                                     <b pay_type_list="PSBC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-17.png"></b>
                                     <b pay_type_list="CMB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-19.png"></b>
                                     <b pay_type_list="CMBC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-21.png"></b>
                                     <b pay_type_list="CITIC"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-29.png"></b>
                                     <b pay_type_list="CEB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-31.png"></b>
                                     <b pay_type_list="HXB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-33.png"></b>
                                     <b pay_type_list="GDB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-35.png"></b>
                                     <b pay_type_list="CIB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-43.png"></b>
                                     <b pay_type_list="SPDB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-45.png"></b>
                                     <b pay_type_list="SPAB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-47.png"></b>
                                     <b pay_type_list="SHB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-49.png"></b>
                                     <b pay_type_list="BJB"><img src="https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/upload/pc/pay_ioc/pay-57.png"></b>
                                   </p>
                             </div>
                              -->
                        <p>
                        	<label></label>
                            <span>
                            	<a href="javascript:void()" class="passeord_but">充值</a>
                            </span>
                        </p>
                    </div>
                   
                    <!----------------------->	
                </div>
            </div>
       <!-------右侧end-------->
        </div>
        <!------------------->
    </div>
</div>
<!--#} -->
<script>
layui.use(['umfTopUp'], function(){
    var popUserAdvance = layui.umfTopUp
    popUserAdvance.init();
});
</script>

<script>
$(document).on('click', '.payment',function(){
	$('.payment').removeClass('active');
	$(this).addClass('active');
	$(".paycenter_list").css("display","none");
	if($(this).attr('value')=='upacppc')
	{
		$(".paycenter_list").css("display","block");
	}
	$('#payType').val($(this).attr('value'));
})
//判断选择银联银行
/*	$(document).on('click', '.paycenter_list b', function () {
		$(this).addClass("atver").siblings().removeClass("atver");
		$('.pay_type_list').val($(this).attr('pay_type_list'));
	})
	*/
$(document).on('click', '.passeord_but',function(){
	var payType=$('#payType').val();
	var rechargeAmount=$('#rechargeAmount').val();
	var bankCode=$('#bankCode').val();
	if(!rechargeAmount){
		 $.alert('error',"请填写充值金额！");
		 return false;
	}
	 var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
	 if (!reg.test(rechargeAmount)||Number(rechargeAmount)==0) {
		 $.alert('error',"请输入合法的充值金额！");
		 return false;
   }
	if(!payType){
		 $.alert('error',"请选择充值方式！");
		 return false;
	}
/*	else{
		if(payType=="upacppc"){
			if(!bankCode){
				 $.alert('error',"请选择银行！");
				 return false;
			}
		}else{
			var bankCode="";
		}
	}
*/	
	 window.location.href="/user/userAdvance/topUpPay.do?payType="+payType+"&rechargeAmount="+rechargeAmount;

})
</script>


<script>
function showWallet() {
    doAjax('/user/userWallet/getUserWallet.json','post','',function(res){
    	var userWallet=res.data.userWallet;
    	$('.advance').html("￥"+userWallet.advance);
    },'');
}	

function showLeftAside() {
	var html=$('.page-aside');
	var righthtml=$('.page-article');
	$('.small-page').empty();
	$('.small-page').append(html);
	$('.small-page').append(righthtml);
}

$('#balance').css({'color':'#6647b2','font-weight':'900'});
</script>
 <style>
    	.payment-item{  position:relative; width:150px;  margin-bottom:15px;}
		.payment-item label{ display:block; text-align:center; line-height:40px; border:1px solid #ccc; background:#FFFFFF; cursor:pointer;}
		.payment-item label.atver{ border: 1px solid #e4393c;}
		.payment-item input[type="radio"]{ display:none;}
		.paycenter_list{width:622px; background:#f4f4f4;    border: 1px solid #dddddd; padding:15px;  padding-bottom:0px;  display:none;position: relative;}
		.paycenter_list p{width:662px;line-height: 20px;}
		.paycenter_list b{display:inline-block; width:140px; height:40px; text-align:center; line-height:39px;    position: relative; overflow:hidden;    margin: 0px 14px 10px 0px; background:#FFFFFF; cursor:pointer; border: 1px solid #dddddd;}
		.paycenter_list b img{max-width:98%; height:auto;}
		.paycenter_list b.atver{ border: 1px solid #e4393c;}
		.paycenter_list s {border-left: 10px solid transparent;  border-right: 10px solid #d8060600;border-bottom: 10px solid #dddddd;position: absolute; top: -10px;left: 156px; }
		.member-mod ul{overflow:inherit;}
		.payment-item input[type="radio"]{top:0px; position:absolute; filter:alpha(opacity=0); opacity:0;display: block; }
    </style>

